class Master(object):
    #初始化
    def __init__(self):
        self.kongfu = '[古法煎饼果子配方]'

    def make_cake(self):
        print(f'运用{self.kongfu}制作煎饼果子')

class School(Master):
    #初始化
    def __init__(self):
        self.kongfu = '[hik煎饼果子配方]'

    def make_cake(self):
        print(f'运用{self.kongfu}制作煎饼果子')

        # 2.1 super带参数写法
        #super(School, self).__init__()
        #super(School, self).make_cake()

        # 2.2 super不带参数写法
        super().__init__()
        super().make_cake()

# 2 定义徒弟类，继承师傅类和学校类， 添加和父类同名的属性和方法
class Prentice(School):
    def __init__(self):
        self.kongfu = '[独创煎饼果子配方]'

    def make_cake(self):
        # 如果是先调用了父类的属性和方法，父类属性会覆盖子类属性，故在调用属性前，先调用自己子类的初始化
        self.__init__()
        print(f'运用{self.kongfu}制作煎饼果子')

    def make_old_cake(self):
        # 方法二: super()
        # 2.1 super(当前类名，self).函数()
        #super(Prentice,self).__init__()
        #super(Prentice, self).make_cake()

        #2.2 super不带参数写法
        super().__init__()
        super().make_cake()


daqiu = Prentice()
print('------------------调用大邱的cake---------------------')
daqiu.make_cake()


daqiu.make_old_cake()


print('------------------再次调用大邱的cake---------------------')
daqiu.make_cake()



